﻿Imports System.Data.OleDb
Imports System.Data
Public Class Dataprovider
    Shared Function connetion() As OleDbConnection
        Dim conetstr As String = "Provider=SQLOLEDB;Data Source=MINHHAI-PC;Integrated Security=SSPI;Initial Catalog=QuanLyNhaSach"
        Dim connetions As New OleDbConnection(conetstr)
        connetions.Open()
        Return connetions
    End Function
    Shared Function ExecuteQuery(ByVal cmd As OleDbCommand) As DataTable
        Dim da As New DataTable()
        Dim cn = connetion()
        Dim adr As New OleDbDataAdapter()
        adr.SelectCommand = cmd
        adr.Fill(da)
        cn.Close()
        Return da
    End Function
    
End Class
